package database.relation;

import java.io.Serializable;
import java.util.ArrayList;

import database.constraint.Constraint;
import database.constraint.ListBusinessConstraint;

public class Table implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1;
    public int index;
	String tableName;
	ArrayList<String> listColumn;
	ArrayList<String> key;
	ArrayList<Constraint> listConstraint;
	ListBusinessConstraint listBConstraint;
	
	public String txtConstraint = "";
	
	public String[] getKey() {
		String[] result = new String[key.size()];
        for(int i = 0; i < key.size(); i++) {
            result[i] = key.get(i);
        }
        return result;
	}
	
	public ArrayList<String> getKeyArrayList() {
	    return key;
	}
	
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String[] getListColumn() {
		String[] result = new String[listColumn.size()];
		for(int i = 0; i < listColumn.size(); i++) {
			result[i] = listColumn.get(i);
		}
		return result;
	}

	public void setListColumn(ArrayList<String> listColumn) {
		this.listColumn = listColumn;
	}

	public Table() {
		listColumn = new ArrayList<String>();
		listConstraint = new ArrayList<Constraint>();
		listBConstraint = new ListBusinessConstraint();
		key = new ArrayList<String>();
	}
	
	public ArrayList<Constraint> getListConstraint() {
		return listConstraint;
	}

	public void setListConstraint(ArrayList<Constraint> listConstraint) {
		this.listConstraint = listConstraint;
	}
	
	public ListBusinessConstraint getListBConstraint() {
        return listBConstraint;
    }

    public void setListBConstraint(ListBusinessConstraint listBConstraint) {
        this.listBConstraint = listBConstraint;
    }
	
}
